<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
	<meta name="referrer" content="no-referrer" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <title>超级搜索</title>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_1534407_dubbnba4ga9.css">
    <link rel="stylesheet" href="https://lib.baomitu.com/Swiper/3.2.6/css/swiper.min.css">

    <style>
       body{font-family:"Microsoft YaHei",arial;background-color:#f2f2f2;width:100%;margin:0 auto}
        [v-cloak]{display:none}
        em,i,th{font-weight:400;font-style:normal}
        input{ -webkit-appearance:none;outline:0;border:none;resize:none;color:#666;background:0 0}
        ol,ul{list-style:none}
        li{list-style-type:none}
        .clearfix:after{display:block;overflow:hidden;clear:both;height:0;visibility:hidden;content:""}
        img{width:100%;display:block}
        *{margin:0;padding:0;-webkit-tap-highlight-color:transparent}
        @media screen and (max-width:319px){html{font-size:42.666665px}
        }
        @media screen and (min-width:320px) and (max-width:359px){html{font-size:42.66666px}
        }
        @media screen and (min-width:360px) and (max-width:374px){html{font-size:48px}
        }
        @media screen and (min-width:375px) and (max-width:383px){html{font-size:50px}
        }
        @media screen and (min-width:384px) and (max-width:399px){html{font-size:51.2px}
        }
        @media screen and (min-width:400px) and (max-width:413px){html{font-size:53.333335px}
        }
        @media screen and (min-width:414px){html{font-size:55.2px}
        }
        @media screen and (min-width:750px){html{font-size:100px}
        .swiper-navbar::-webkit-scrollbar{width:0;height:0;background-color:#fafafa}
        .swiper-navbar::-webkit-scrollbar-thumb{border-radius:0;background-color:rgba(0,0,0,0)}
        }
        #app{min-height:100vh;width:100%;position:relative}
        .maincontent{width:7.1rem;left:50%;margin:.3rem auto 0;overflow:auto;-webkit-overflow-scrolling:touch}
        .shopdetails{background-color:#fff}
        .shopdetails:nth-child(1){border-radius:.15rem .15rem 0 0}
        .shop-box{position:relative;display:-webkit-flex;display:flex;padding:.19rem .14rem .2rem .14rem}
        .box-left{position:relative;overflow:hidden;border-radius:.1rem}
        .box-left img{width:2.2rem;height:2.2rem;border-radius:.1rem}
        .leftbottom-num{position:absolute;left:0;bottom:0;font-size:.24rem;color:rgba(255,255,255,1);background:linear-gradient(-35deg,rgba(235,3,1,1),rgba(255,38,62,1),rgba(255,91,57,1));border-radius:0 .2rem 0 .1rem;display:flex;align-items:center;justify-content:center;padding:.05rem .1rem}
        .box-right{width:-webkit-calc(100% - 2.2rem);width:calc(100% - 2.2rem);display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:space-between;justify-content:space-between;padding:.1rem 0}
        .box-right-top{padding-left:.3rem}
        .discount-num{display:flex;align-items:center}
        .shopname{word-wrap:normal;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:.26rem;font-family:"PingFang SC";font-weight:500;color:rgba(51,51,51,1);padding-bottom:.05rem}
        .buy-num{display:flex;align-items:center;justify-content:center;position:relative}
        .buy-num em{position:relative;margin:0 .15rem}
        .buy-num em:after{position:absolute;width:1px;height:.18rem;top:-.08rem;right:0;content:'';display:block;background:rgba(253,231,235,1)}
        .buy-num i{font-size:.3rem;color:#e8985e}
        .buy-num p{font-size:.2rem;font-family:"PingFang SC";font-weight:400;color:#e8985e}
        .brand{display:flex;align-items:center}
        .brandlabel{display:flex;align-items:center}
        .brandimg{width:.3rem;height:.3rem;border:1px solid #ffd6da;border-radius:50%;background-color:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center}
        .brandimg img{max-width:100%;width:auto;max-height:100%}
        .brandname{color:#666;font-size:.24rem;padding-left:.1rem}
        .discount-price{font-size:.16rem;font-family:"PingFang SC";font-weight:500;color:#e8985e;border:1px solid rgba(210,140,53,.5);background:rgba(210,140,53,.05);padding:0 .06rem;display:flex;align-items:center;justify-content:center}
        .discount-price span{font-size:.2rem}
        .box-right-bottom{display:flex;width:100%;height:1rem;align-items:center;justify-content:space-between;background:linear-gradient(90deg,rgba(210,140,53,.1) 0,rgba(210,140,53,0) 100%)}
        .price{padding-left:.25rem}
        .price p:first-child{height:.2rem;font-size:.2rem;font-family:"PingFang SC";font-weight:400;text-decoration:line-through;color:rgba(102,102,102,1);line-height:.2rem;padding-bottom:.1rem}
        .price p:last-child{height:.26rem;font-size:.24rem;font-family:"PingFang SC";font-weight:500;color:#e8985e;line-height:.26rem}
        .price p:last-child span{font-size:.26rem;font-weight:700}
        .panicbuy{width:1.3rem;height:.55rem;background:#e8985e;border-radius:.05rem;display:flex;align-items:center;justify-content:center;font-size:.24rem;color:rgba(255,254,253,1);cursor:pointer}
        .backtotop{position:fixed;width:1rem;height:1rem;right:.39rem;bottom:.64rem;border-radius:50%;border:1px solid rgba(210,140,53,1);font-size:.16rem;font-weight:400;color:#e8985e;display:flex;align-items:center;justify-content:center;flex-direction:column;background:#fff;cursor:pointer;-webkit-box-shadow:0 4px 12px 2px rgba(0,0,0,.1)}
        .backtotop i{font-size:.28rem}
        .realpic-loading{color:#999;font-size:.24rem;text-align:center;margin:2px 0}
        .vmIconLoad{width:.32rem;height:.32rem;font-size:20px;color:#4d74ff;display:inline-block;vertical-align:middle;background-image:url(http://img-haodanku-com.cdn.fudaiapp.com/Fs3CUOAV8FeUjyhyU-3xOO5DSphI);background-repeat:no-repeat;background-size:100% 100%;-webkit-animation:vmspinLoad 2s infinite linear;animation:vmspinLoad 1.2s infinite linear}
        .realpic-loading em{display:inline-block;vertical-align:middle;font-style:inherit}
        .vmIconLoad:before{ -webkit-font-smoothing:antialiased;transform:translate(0,0)}
        @keyframes vmspinLoad{from{transform:rotate(0)}
        50%{transform:rotate(180deg)}
        to{transform:rotate(360deg)}
        }
        @-webkit-keyframes vmspinLoad{from{transform:rotate(0)}
        50%{transform:rotate(180deg)}
        to{transform:rotate(360deg)}
        }
        .header-wrap{position: relative; width:7.5rem;background-color:#fff;margin:0 auto;z-index:100}
        .header-search{width:93%;margin:0 auto;border:.04rem solid rgba(237,237,237,1);border-radius:0 .45rem .45rem 0;display:flex;align-items:center;justify-content:center;border-radius:.45rem;height:.84rem;background:rgba(237,237,237,1);align-items:stretch;overflow:hidden}
        .header-search i{width:.9rem;flex-shrink:0;display:flex;align-items:center;justify-content:center;color:#e8985e;font-weight:700;font-size:.4rem}
        .header-search input{flex:1;color:#333;line-height:1.2;font-size:.24rem;display:flex;align-items:center}
        .header-search em{width:1.2rem;display:flex;justify-content:center;align-items:center;color:#e8985e;font-size:.24rem;font-weight:700;flex-shrink:0;cursor:pointer;background:#fff}
        .header-search-box{width:.6rem;display:flex;align-items:center;justify-content:center;font-size:.28rem;color:#999}
        .header-search-box span{font-size:.38rem}
        input::-webkit-input-placeholder{color:#999;font-size:.24rem;font-family:"微软雅黑",Arial,sans-serif}
        .shopdetails-null{margin-top:.4rem}
        .shopdetails-null>img{display:block;width:3.51rem;margin:0 auto}
        .shopdetails-null p{color:#e8985e;font-size:.28rem;text-align:center}
        .shopdetails-null i{display:block;text-align:center;font-size:.24rem;color:#999;margin-top:.06rem}
        .shopdetails-null em{display:block;width:1.7rem;height:.64rem;background-color:#e8985e;margin:0 auto;text-align:center;line-height:.64rem;font-size:.28rem;color:#fff;border-radius:.08rem;margin-top:.24rem;cursor:pointer}
        .hot_keyword{width:88%;margin:0 auto 0;color:#666;font-size:.2rem;padding:.18rem .06rem .18rem .02rem}
        .hot_keyword-box span{border-radius:.26rem;border:1px solid #e6e6e6;font-size:.2rem;padding:.08rem .12rem;margin-right:.1rem;cursor:pointer;width:auto;display:flex;align-items:center;justify-content:center}
        .hot_keyword-box span.active{color:#e8985e;border:1px solid #e8985e}
        .swiper-course{width:4.87rem;height:4.33rem;margin:.86rem auto}
        .swiper-pagination{position:initial;text-align:center;margin-top:1rem}
        .swiper-pagination span{margin-left:.1rem;background-color:#d9d9d9;opacity:1;width:.1rem;height:.1rem}
        .swiper-pagination .swiper-pagination-bullet-active{background-color:#e8985e}
        .swiper-pagination span:nth-child(1){margin-left:0}
        .Econtent{position:fixed;top:50%;left:50%;display:none;width:5.8rem;height:6.88rem;margin-left:-2.9rem;margin-top:-3.44rem;background:url(http://img.fqapps.com/258627940aca1f586048a2b314e2d19a) no-repeat;background-size:90% 90%;background-position:50% 50%}
        .Econtent-box{position:relative;padding-top:3.84rem}
        .taokolintext{text-align:center;color:#fff;height:.4rem}
        .btnBox{color:rgba(255,255,255,.4);text-align:center;font-size:.22rem;margin-top:.6rem}
        .Econtent-box span{position:absolute;bottom:-2rem;left:50%;margin-left:-.3rem;width:.6rem;height:.6rem;background:url(http://img-haodanku-com.cdn.fudaiapp.com/Fo2-nJ_43fsFStbAfqMUEcCFJnJ6);background-size:100% 100%;cursor:pointer}
        .mainnav{position:relative;padding-top:.3rem}
        .mainnav-fixed{position:fixed;top:0;left:0;width:100%;background:#fff;border-radius:0;z-index:1000}
        .mainnav-fixed .partnav{border-radius:0}
        .mainnav-fixed .hot_keyword{display:none}
        .mainnav-fixed .sort{border-top:none}
        .sort{width:100%;display:flex;justify-content:center;align-items:center;border-top:1px solid rgba(237,237,237,1)}
        .sort li{display:inline-flex;flex:1;justify-content:center;align-items:center;color:#666;font-size:.24rem;padding:.25rem 0;position:relative}
        .sort li.active{color:#e8985e}
        .sort li::before{content:"";position:absolute;top:50%;left:0;width:1px;height:.4rem;margin-top:-.2rem;background:rgba(238,238,238,1)}
        .sort li:nth-child(1)::before{content:initial}
        .sort li p{position:relative;height:.2rem;margin-left:.1rem}
        .sort li p em{position:absolute;width:0;height:0;border-color:#999 transparent transparent;border-style:solid;border-width:.08rem .08rem 0;content:''}
        .sort li p em.active{border-color:#e8985e transparent transparent}
        .sort li p em:nth-child(1){transform:rotate(180deg)}
        .sort li p em:nth-child(2){bottom:0}
        .nav-back {
			width: 9.33vw;
			height: 9.33vw;
			max-width: 50px;
			max-height: 50px;
			background-color: rgba(0,0,0,.35);
			position: fixed;
			top: 15px;
			left: 15px;
			border-radius: 50%;
			z-index: 1100;
		}
		.back-btn {
			width: 80%;
			height: 80%;
			transform: rotate(90deg);
			fill: #fff;
			margin-top: 9%;
			margin-left: 8%;
			display: block;
		}
    </style>
</head>

<body>
	<div class="nav-back" onclick="window.history.back()" style="display: none;">
	  <svg class="back-btn" t="1621839705485" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5448" width="200" height="200"><path d="M511.31 669.4a61.19 61.19 0 0 1-43.25-17.79l-237.12-237.2a35 35 0 0 1 49.55-49.55l230.89 230.9 230.9-230.89a35 35 0 1 1 49.55 49.55L554.7 651.54a61.41 61.41 0 0 1-43.39 17.86z" p-id="5449"></path></svg>
	</div>
    <div id="app" v-cloak>
        <div class="header-wrap">
            <img src="http://img-haodanku-com.cdn.fudaiapp.com/Fvd1gxssFdwtkWMysY4P7kWM8uGn">
            <div class="mainnav" ref="mainnav" :class="{'mainnav-fixed': mainnavFixed}">
                <div class="header-search">
                    <i class="hdk-sousuo iconfont"></i>
                    <input type="text" placeholder="搜索更多超值商品" v-model="keyword" @keyup.enter="searchBtn()"
                        id="searchInput">
                    <div class="header-search-box" v-if="keyword.length>0" v-on:click="clearFun()">
                        <span class="hdk-guanbi iconfont"></span>
                    </div>
                    <em v-on:click="searchBtn()">搜索</em>
                </div>
                <div class="hot_keyword swiper-navbar swiper-container">
                    <div class="hot_keyword-box swiper-wrapper">
                        <span class="swiper-slide" v-for="(item,index) in hotkeywordArr"
                            v-on:click="hotkeywordBtn(item.keyword)"
                            :class="item.keyword == keyword?'active':''" v-if="item.jump_url==''">{{item.keyword}}</span>
                    </div>
                </div>
                <ul class="sort">
                    <li v-on:click="sortFun(0)" :class="sortType == 0 && !swiperBool?'active':''">综合</li>
                    <li v-on:click="sortFun(1)" :class="sortType == 1 && !swiperBool?'active':''">最新</li>
                    <li v-on:click="sortFun(2)" :class="(sortType == 2 || sortType == 3) && !swiperBool?'active':''">销量<p>
                            <em :class="sortType == 3 && !swiperBool ?'active':''"></em><em
                                :class="sortType == 2  && !swiperBool ?'active':''"></em></p>
                    </li>
                    <li v-on:click="sortFun(3)" :class="(sortType == 4 || sortType == 5) && !swiperBool?'active':''">价格<p>
                            <em :class="sortType == 4 && !swiperBool?'active':''"></em><em :class="sortType == 5 && !swiperBool?'active':''"></em></p>
                    </li>
                </ul>
            </div>
        </div>
        <div class="maincontent" v-if="!swiperBool">
            <div class="shopdetails" v-for="(item,index) in shopData">
                <div class="shop-box">
                    <div class="box-left">
                        <img :src="item.itempic | imgSrc">
                    </div>
                    <div class="box-right">
                        <div class="box-right-top">
                            <p class="shopname">
                                {{item.itemshorttitle}}
                            </p>
                            <div class="discount-num">
                                <div class="buy-num"><i class="iconfont hdk-huo"></i>
                                    <p>该商品已抢{{item.itemsale | conversion}}件</p> <em></em>
                                </div>
                                <div class="discount-price">优惠券<span>￥{{item.couponmoney}}</span></div>
                            </div>
                        </div>
                        <div class="box-right-bottom">
                            <div class="price">
                                <p>原价：￥{{parseFloat(item.itemprice)}}</p>
                                <p>券后价：<span>￥{{parseFloat(item.itemendprice)}}</span></p>
                            </div>
                            <div :id="'shop'+index" class="panicbuy" v-on:click="tokenBtn(index,item)">立即抢购</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="shopdetails-null" v-if="wholeShow">
                <img src="http://img-haodanku-com.cdn.fudaiapp.com/Fgpgmsc8EEXS6aN5Y7eJme3PzJo6">
                <p>抱歉，暂时没有搜索到合适商品</p>
                <i>我们会努力寻找更多的商品哦~</i>
                <em v-on:click="regBtn()">重新搜索</em>
            </div>
            <div style="padding-bottom: 0.2rem;" v-if="!wholeShow">
                <p class="realpic-loading" v-if="loadshow"><i class="vmIconLoad"></i><em>数据加载中...</em></p>
                <p class="realpic-loading" v-else>没有更多商品了</p>
            </div>
        </div>
        <div v-else>
            <div class="swiper-container swiper-course">
                <div class="swiper-wrapper">
                    <div class="swiper-slide">
                        <img src="http://img-haodanku-com.cdn.fudaiapp.com/FlvbOd2Tlo3_J-oSOTLnlTeICK29">
                    </div>
                    <div class="swiper-slide">
                        <img src="http://img-haodanku-com.cdn.fudaiapp.com/FrpoQ0XS4p8Mkvyt-ZC4h9A7X28I">
                    </div>
                    <div class="swiper-slide">
                        <img src="http://img-haodanku-com.cdn.fudaiapp.com/FsVELYCSSSF2ojfgQoHp7CxnrkH3">
                    </div>
                </div>
            </div>
            <div class="swiper-pagination"></div>
        </div>
        <div class="backtotop" v-on:click="goTop()" v-if="swtichTop">
            <i class="iconfont hdk-paixu"></i>
            <p>返回顶部</p>
        </div>
        <div>
            <div class="Econtent">
                <div class="Econtent-box">
                    <div class="taokolintext">{{Token}}</div>
                    <div class="btnBox">手动长按复制口令</div>
                    <span v-on:click='layer.closeAll()'></span>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/Swiper/3.2.6/js/swiper.min.js"></script>
    <script src="https://cdn.staticfile.org/vue/2.6.10/vue.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/layer/2.3/layer.js"></script>
    <script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script>

    <script>
        var vmUrlSearchs = null;
        function vmRequest(name) {
            if (!vmUrlSearchs) {
                vmUrlSearchs = new vmUrlSearch();
            }
            return vmUrlSearchs[name];
        };

        function vmUrlSearch() {
            var name, value;
            var str = location.href;
            var num = str.indexOf("?");
            str = str.substr(num + 1);
            var arr = str.split("&");
            for (var i = 0; i < arr.length; i++) {
                num = arr[i].indexOf("=");
                if (num > 0) {
                    name = arr[i].substring(0, num);
                    value = arr[i].substr(num + 1);
                    this[name] = value;
                }
            }
        };
		var keyword = vmRequest("q")
		if(!keyword){
			keyword = '';
		}else{
			keyword = decodeURIComponent(keyword);
		}
		var yid = "123456";
		if(vmRequest("yid")){
			yid = vmRequest("yid")
		}
		if(vmRequest("back")){
			$(".nav-back").css("display","block")
		}
        var app = new Vue({
            el: "#app",
            data: {
                apikey: 'zqapi',
				yid: yid,
                keyword: keyword,
                back: 10,
                min_id: 1,
                shopData: [],
                loadmsg: true,
                loadshow: true,
                wholeShow: false,
                swtichTop: false,   // 返回顶部
                hotkeywordArr: [],
                swiperBool: true,
                Token: '',
                codeId: vmRequest('code'),
                shopdetailsTop: 0,
                mainnavFixed: false,
                sortType: 0,
            },
            created: function () {
                this.hotkeyword();
            },
            mounted: function () {
                var self = this;
                this.swiperFun();
				if(this.keyword.length > 0) this.ajaxShop(true);
                setTimeout(function () {
                    var distanceTop = self.$refs.mainnav.getBoundingClientRect().top;
                    var mainnavHeight = self.$refs.mainnav.getBoundingClientRect().height;

                    window.addEventListener('scroll', function () { //下拉加载
                        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;

                        // 当滑动距离大于等于分类距离顶部位置时，则固定定位
                        if (!self.swiperBool ) {
                            if (scrollTop >= distanceTop) {
                                self.mainnavFixed = true;
                                self.shopdetailsTop = mainnavHeight;
                            } else {
                                self.mainnavFixed = false;
                                self.shopdetailsTop = 0;
                            }

                            // 滑动距离大于580时，就显示返回顶部按钮 否则则隐藏
                            (scrollTop > 580) ? self.swtichTop = true : self.swtichTop = false;
                            if (scrollTop + window.innerHeight >= document.body.offsetHeight) {
                                if (self.loadmsg) {
                                    self.loadmsg = false;
                                    self.ajaxShop();
                                }
                            }
                        }else{
                            self.mainnavFixed = false;
                            self.shopdetailsTop = 0;
                        }
                    });
                }, 100)

            },
            filters: {
                imgSrc: function (url) {
                    if (url.indexOf('.png') == '-1') {
                        return url + '_310x310.jpg';

                    } else {
                        return url;
                    }
                },
                conversion: function (number) {
                    if (number) {
                        if (number.length <= 4) return number;
                        if (number.length >= 5) {
                            var number_2 = Math.round((number / 10000) * 100) / 100 + '万';
                            return number_2;
                        }
                    }
                },
            },
            methods: {
                ajaxShop: function (Callback) {
                    var self = this;
                    if (self.keyword == '') {
                        layer.msg('清输入关键字搜索', {
                            time: 2000,
                            shade: 0.1,
                            shadeClose: true
                        })
                        self.swiperBool = true;
                        setTimeout(function () {
                            self.swiperFun();
                        }, 30);
                        this.sortType = 0;
                        return;
                    }
                    self.swiperBool = false;
                    $.ajax({
                        type: 'GET',
                        url: 'https://tkf.ink/ratesurl/',
                        data: {
                            type: 'supersearch',
                            keyword: encodeURIComponent(encodeURIComponent(self.keyword)),
                            back: self.back,
                            min_id: self.min_id,
                            sort: self.sortType
                        },
                        dataType: 'json',
                        timeout: 5000,
                        success: function (data) {
                            if (data.code) {
                                self.shopData = self.shopData.concat(data.data);
                                if (data.data.length < 10) {
                                    self.loadmsg = false;
                                    self.loadshow = false;
                                } else {
                                    self.loadmsg = true;
                                    self.loadshow = true;
                                    self.min_id++;
                                }
                                self.wholeShow = false;
                            } else {
                                if (Callback) {
                                    self.wholeShow = true;
                                }
                                self.loadmsg = false;
                                self.loadshow = false;
                            }

                        },
                        error: function () {
                            self.loadmsg = false;
                            self.loadshow = false;
                        },
                    });
                },
                searchBtn: function () {
                    this.shopData = [];
                    this.min_id = 1;
                    this.loadmsg = false;
                    this.loadshow = true;
                    this.ajaxShop(true);
                },
                regBtn: function () {
                    document.getElementById('searchInput').focus();
                    this.keyword = '';
                },
                goTop: function () { //返回顶部
                    document.documentElement.scrollTop = 0;
					document.body.scrollTop = 0
                },
                hotkeyword: function () {  //热门关键字
                    var self = this;
                    $.ajax({
                        type: 'GET',
                        url: 'https://v2.api.haodanku.com/hot_keyword',
                        data: {},
                        dataType: 'json',
                        timeout: 5000,
                        success: function (data) {
                            if (data.code == 200) {
                                self.hotkeywordArr = data.data;
                                self.$nextTick(function () {
                                    self.swiperNav();
                                })
                            }

                        },
                        error: function () {

                        },
                    });
                },
                hotkeywordBtn: function (value) {
                    this.shopData = [];
                    this.min_id = 1;
                    this.loadmsg = false;
                    this.loadshow = true;
                    this.keyword = value;
                    this.ajaxShop(true);
                },
                swiperNav: function () {
                    var swiper1 = new Swiper('.swiper-navbar', {
                        // prevButton: '.swiper-button-prev0',
                        // nextButton: '.swiper-button-next0',
                        slidesPerView: 'auto',

                        roundLengths: true,
                        paginationClickable: true,
                        // spaceBetween: 0,
                    });
                },
                swiperFun: function () {
                    var swiper1 = new Swiper('.swiper-course', {
                        roundLengths: true,
                        paginationClickable: true,
                        pagination: '.swiper-pagination',
                    });
                },
                tokenBtn: function (oIndex, item) {
                    // this.dusLoad = true;
                    var self = this;

                    $.ajax({
                        type: 'Post',
                        url: 'https://tkf.ink/ratesurl/',
                        data: {
                            yid: this.yid,
                            itemid: item.itemid,
                            activityid: item.activityid,
                        },
                        dataType: 'json',
                        timeout: 5000,
                        async: false,
                        success: function (data) {
                            self.dusLoad = false;
                            if (data.code == "1") {
                                self.Token = data.data.taoword;
                            } else {
                                self.Token = '';
                                layer.msg(data.msg, {
                                    time: 2000,
                                    shade: 0.1,
                                    shadeClose: true
                                })
                            }
                        },
                        error: function () {
                            self.Token = '';
                            layer.msg('网络错误，请检查网络重试', {
                                time: 2000,
                                shade: 0.1,
                                shadeClose: true
                            })
                        },
                    });
                    self.copyBtn(oIndex);
                },
                copyBtn: function (oIndex) { //复制公共方法
                    var self = this;
                    var clipboard = new ClipboardJS('#shop' + oIndex, {
                        text: function (target) {
                            return self.Token;
                        }
                    });
                    clipboard.on('success', function (e) {
                        layer.msg('复制口令成功,请打开淘宝领取', {
                            shade: 0.4,
                            time: 2000,
                            shadeClose: true,
                        }, function () {
                            layer.closeAll();
                        });
                        e.clearSelection();
                        clipboard.destroy();
                    });
                    clipboard.on('error', function (e) {
                        layer.msg('复制口令失败！', {
                            shade: 0.4,
                            time: 1000,
                            shadeClose: false,
                        }, function () {
                            layer.open({
                                type: 1,
                                shift: 0,
                                title: false,
                                closeBtn: 0,
                                shade: 0.4,
                                shadeClose: true,
                                content: $('.Econtent')
                            });
                        });
                    });
                },
                sortFun: function (number) {  //
                    if (this.swiperBool) {
                        layer.msg('清输入关键字搜索', {
                            time: 2000,
                            shade: 0.1,
                            shadeClose: true
                        })
                        return;
                    }
                    this.shopData = [];
                    this.min_id = 1;
                    this.loadmsg = false;
                    this.loadshow = true;
                    switch (number) {
                        case 0:
                            this.sortType = 0;
                            break;
                        case 1:
                            this.sortType = 1;
                            break;
                        case 2:
                            if (this.sortType == 2) {
                                this.sortType = 3;
                            } else {
                                this.sortType = 2;
                            }
                            break;
                        case 3:
                            if (this.sortType == 4) {
                                this.sortType = 5
                            } else {
                                this.sortType = 4;
                            }
                            break;
                    }
                    this.ajaxShop();
                },
                clearFun:function(){  // 清除关键字
                    this.shopData = [];
                    this.keyword = '';
                    this.sortType = 0;
                    this.swiperBool = true;
                }
            },
        })
    </script>
</body>

</html>